package me.mcx.mcx.service.impl;

import java.util.List;
import me.mcx.common.utils.DateUtils;
import me.mcx.mcx.domain.McxHonor;
import me.mcx.mcx.mapper.McxHonorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import me.mcx.mcx.service.IMcxHonorService;

/**
 * 荣誉墙Service业务层处理
 * 
 * @author mcx
 * @date 2024-09-21
 */
@Service
public class McxHonorServiceImpl implements IMcxHonorService 
{
    @Autowired
    private McxHonorMapper mcxHonorMapper;

    /**
     * 查询荣誉墙
     * 
     * @param id 荣誉墙主键
     * @return 荣誉墙
     */
    @Override
    public McxHonor selectMcxHonorById(Long id)
    {
        return mcxHonorMapper.selectMcxHonorById(id);
    }

    /**
     * 查询荣誉墙列表
     * 
     * @param mcxHonor 荣誉墙
     * @return 荣誉墙
     */
    @Override
    public List<McxHonor> selectMcxHonorList(McxHonor mcxHonor)
    {
        return mcxHonorMapper.selectMcxHonorList(mcxHonor);
    }

    /**
     * 新增荣誉墙
     * 
     * @param mcxHonor 荣誉墙
     * @return 结果
     */
    @Override
    public int insertMcxHonor(McxHonor mcxHonor)
    {
        mcxHonor.setCreateTime(DateUtils.getNowDate());
        return mcxHonorMapper.insertMcxHonor(mcxHonor);
    }

    /**
     * 修改荣誉墙
     * 
     * @param mcxHonor 荣誉墙
     * @return 结果
     */
    @Override
    public int updateMcxHonor(McxHonor mcxHonor)
    {
        mcxHonor.setUpdateTime(DateUtils.getNowDate());
        return mcxHonorMapper.updateMcxHonor(mcxHonor);
    }

    /**
     * 批量删除荣誉墙
     * 
     * @param ids 需要删除的荣誉墙主键
     * @return 结果
     */
    @Override
    public int deleteMcxHonorByIds(Long[] ids)
    {
        return mcxHonorMapper.deleteMcxHonorByIds(ids);
    }

    /**
     * 删除荣誉墙信息
     * 
     * @param id 荣誉墙主键
     * @return 结果
     */
    @Override
    public int deleteMcxHonorById(Long id)
    {
        return mcxHonorMapper.deleteMcxHonorById(id);
    }
}
